package com.example.demo.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
public class Zdyxxinfo {
    private int zdyxxId;
    private String jskf;
    private String tdpwx;
    private String xcjg;
    private String yxcp;
    private Xsjhinfo xsjh;

    @Id
    @Column(name = "zdyxxId", nullable = false)
    public int getZdyxxId() {
        return zdyxxId;
    }

    public void setZdyxxId(int zdyxxId) {
        this.zdyxxId = zdyxxId;
    }

    @Basic
    @Column(name = "jskf", nullable = true, length = 2)
    public String getJskf() {
        return jskf;
    }

    public void setJskf(String jskf) {
        this.jskf = jskf;
    }

    @Basic
    @Column(name = "tdpwx", nullable = true, length = 20)
    public String getTdpwx() {
        return tdpwx;
    }

    public void setTdpwx(String tdpwx) {
        this.tdpwx = tdpwx;
    }

    @Basic
    @Column(name = "xcjg", nullable = true, length = 10)
    public String getXcjg() {
        return xcjg;
    }

    public void setXcjg(String xcjg) {
        this.xcjg = xcjg;
    }

    @Basic
    @Column(name = "yxcp", nullable = true, length = 10)
    public String getYxcp() {
        return yxcp;
    }

    public void setYxcp(String yxcp) {
        this.yxcp = yxcp;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zdyxxinfo zdyxxinfo = (Zdyxxinfo) o;
        return zdyxxId == zdyxxinfo.zdyxxId &&
                Objects.equals(jskf, zdyxxinfo.jskf) &&
                Objects.equals(tdpwx, zdyxxinfo.tdpwx) &&
                Objects.equals(xcjg, zdyxxinfo.xcjg) &&
                Objects.equals(yxcp, zdyxxinfo.yxcp);
    }

    @Override
    public int hashCode() {
        return Objects.hash(zdyxxId, jskf, tdpwx, xcjg, yxcp);
    }

    @OneToOne(mappedBy = "zdyxx")
    public Xsjhinfo getXsjh() {
        return xsjh;
    }

    public void setXsjh(Xsjhinfo xsjh) {
        this.xsjh = xsjh;
    }
}
